package design_pattern.inversion;

/**
 * @Name : inversion.DependencyInversion
 * @Description : 描述
 * Created by cyd on 2020-12-14 09:10:30
 */
public class DependencyInversion {
    public static void main(String[] args) {
        Person person = new Person();
        person.receive(new Email());
    }
}

class Email {
    public String getInfo() {
        return "email:hello";
    }
}

class Person {
    public void receive(Email email) {
        System.out.println(email.getInfo());
    }
}
